<!--
 * @Author: ChunLai
 * @Date: 2021-11-25 09:38:17
 * @LastEditTime: 2023-08-10 08:25:56
 * @Description: 授权文件---公共
 * @FilePath: \0.newInsure\src\views\bankcard\components\ReadAuthorization.vue
-->
<template>
  <div class="read-authorization-module">
    <div class="sure-title">
      {{ title }}
    </div>
    <div class="sure-content">
      <div class="con-main">
        <div class="con-box" v-html="content"></div>
      </div>
    </div>
    <div class="sure-btn">
      <van-checkbox
        v-model="radioBtn"
        checked-color="#ee0a24"
        shape="square"
        icon-size="14px"
        @change="changeRadio"
      >
        {{ btnText }}
      </van-checkbox>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  name: 'ReadAuthorization',
  data() {
    return {
      radioBtn: '',
    };
  },
  components: {},
  computed: {
    ...mapGetters({
      bankTransferAuthorization: 'dictionary/bankTransferAuthorization',
    }),
    title() {
      let res = '银行自动转账授权书';
      if (this.bankTransferAuthorization.title) {
        res = this.bankTransferAuthorization.title;
      }
      return res;
    },
    content() {
      let res = '';
      if (this.bankTransferAuthorization.content) {
        res = this.bankTransferAuthorization.content;
      }
      return res;
    },
    btnText() {
      let res = '本人已阅读并同意以上银行自动转账授权书申明';
      if (this.bankTransferAuthorization.btnText) {
        res = this.bankTransferAuthorization.btnText;
      }
      return res;
    },
  },
  created() {},
  mounted() {},
  methods: {
    changeRadio(value) {
      this.$emit('changeRadio', value);
    },
  },
};
</script>

<style lang="less" scoped>
.read-authorization-module {
  margin-top: 10px;
  border-radius: 10px;
  background-color: #fff;
}
.sure-title {
  line-height: 2;
  padding: 10px 14px;
  background-color: #fffdd4;
}
.sure-content {
  width: 100%;
  padding: 0 14px;
  margin-top: 10px;
  .con-main {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    overflow-y: scroll;
    border: 1px solid #dedee0;
    padding: 6px;
  }
}
.sure-btn {
  padding: 14px;
}

.read-authorization-module {
  /deep/.van-checkbox__label {
    color: #1e2fa5;
  }
}
</style>
